﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace JY.Wpf.Core.Converters
{
    /// <summary>
    /// bool翻转转换器
    /// </summary>
    public class BoolTurnConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool result = true;
            if (value != null)
            {
                bool.TryParse(value.ToString(), out result);
            }
            return !result;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
